package com.ciei.dpagm.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ciei.dpagm.common.service.BaseService;
import com.ciei.dpagm.entity.ChipInterfacePinFunction;
import com.ciei.dpagm.mapper.ChipInterfacePinFunctionMapper;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wangyan
 * @date 2023/05/08
 */
@Service
public class ChipInterfacePinFunctionService extends BaseService<ChipInterfacePinFunctionMapper, ChipInterfacePinFunction> {


    /**
     * 获取列表
     * @param pinName
     * @param chipInterfaceIdList
     * @return
     */
    public List<ChipInterfacePinFunction> getList(String pinName,List<Integer> chipInterfaceIdList){
        if(chipInterfaceIdList.isEmpty()){
            return new ArrayList<>();
        }
        LambdaQueryWrapper<ChipInterfacePinFunction> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(ChipInterfacePinFunction::getPinName,pinName)
                .in(ChipInterfacePinFunction::getInterfaceId,chipInterfaceIdList);
        return list(lambdaQueryWrapper);
    }
}
